package dal

// ConsultStudentInfo 心理咨询学生基本信息表
type ConsultStudentInfo struct {
	StudentNum   string `gorm:"primaryKey;type:varchar(10)" json:"studentNum"`
	Name         string `gorm:"" json:"name"`
	Gender       string `gorm:"index" json:"gender"`
	Birthday     string `gorm:"" json:"birthday"`
	Organization string `gorm:"index" json:"organization"`
	Enrolledyear string `gorm:"" json:"enrolledyear"`
	Stutype      string `gorm:"" json:"stutype"`
	Schoolstate  string `gorm:"" json:"schoolstate"`
}

func (s *ConsultStudentInfo) GetByStuNum(num string) (ConsultStudentInfo, error) {
	var cstuInfo ConsultStudentInfo
	return cstuInfo, DB.Where("student_num = ?", num).First(&cstuInfo).Error
}
